#include <crtdbg.h>
#include <Windows.h>
#include <tchar.h>

#ifndef __TKUIMICRO__H__
#define __TKUIMICRO__H__
#pragma once

#ifndef ASSERT
#define ASSERT(expr)  _ASSERTE(expr)
#endif


#define TKUI_DECLARE_WND_CLASS(ClassName,WindowClassName,ClassStyle,ExStyle,Style)	\
		LPCTSTR ClassName::GetWindowClassName() const{	\
			return WindowClassName;	\
		}	\
		UINT ClassName::GetClassStyle() const{	\
			return ClassStyle;	\
		}	\
		UINT ClassName::GetExStyle() const{	\
			return ExStyle;	\
		}\
		UINT ClassName::GetStyle() const{	\
			return Style;	\
		}




#define TKUI_BEGIN_MSG_MAP(ClassName)	\
		BOOL HandleMessage(UINT uMsg,WPARAM wParam,LPARAM lParam,LRESULT& result)	\
		{	\

#define TKUI_MESSAGE_HANDLE(MSG,FUNC)	\
			if(uMsg == MSG)		\
			{	\
				if(FUNC(uMsg,wParam,lParam,result))	\
					return TRUE;					\
			}

#define TKUI_CHAIN_MESSAGE_MAP(ClassName)	\
			if(ClassName::HandleMessage(uMsg,wParam,lParam,result)){		\
				return TRUE;		\
			}


#define TKUI_END_MSG_MAP()	\
			result = ::DefWindowProc(m_hWnd,uMsg,wParam,lParam);	\
			return TRUE;	\
		}

	



#endif